import com.sun.org.apache.xerces.internal.impl.xs.SchemaNamespaceSupport;

import java.util.Scanner;

public class Test5 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int[] arr = {1,2,3,4,5,6,10,7,8,9};
        System.out.println("请输入数字: ");
        int num = input.nextInt();
        fun(arr,num);
    }
    public static void fun(int[] arr, int num) {
        int flag = -1;
        int i=0, j=0;
        for (i = 0; i < arr.length; i++) {
            if(arr[i] < num) {
                for (j = i + 1; j < arr.length; j++) {
                    if((arr[i] + arr[j]) == num) {
                        flag = 1;
                        break;
                    }
                }
            }
            if(flag == 1) {
                System.out.println("[" + i + "," + j +"]");
                break;
            }
        }
    }
}
